package com.han.hotelplat.cms.controller.logger;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.han.hotelplat.comm.ResponseWrapTo;
import com.han.hotelplat.comm.ResponseWrapTo.CodeType;
import com.han.hotelplat.comm.base.Pager;
import com.han.hotelplat.manager.LogManager;
import com.han.hotelplat.pojo.log.Logger;

@Controller
@RequestMapping("/cms/logger")
public class CMSLoggerController {
	@Autowired
	private LogManager logManager;
	
	@ResponseBody
	@RequestMapping(value = "getAllLogInfo", produces = "application/json;charset=UTF-8", method = { RequestMethod.GET,RequestMethod.POST  })
	public String getAllLogInfo(String startDate, String endDate, String context, Integer pageNo){
		Pager<Logger> data = logManager.getAllLogInfoByPage(startDate,endDate,context, pageNo);
		return new ResponseWrapTo(CodeType.success, "数据获取成功", data).toJson();
	}
}
